import { observable, action, runInAction } from "mobx";
import { getHomeData } from "apis/home";
import { message } from "antd";

class Store {
  @observable
  city = "beijing";

  @observable
  author = "";

  @action.bound
  changeHomeData() {
    getHomeData()
      .then(res => {
        this.author = res.data.data.author;
      })
      .catch(() => {
        message.warning("请求失败");
      });
  }
}

export default new Store();
